package com.yyh.mapper;

import com.yyh.entity.Follow;
import com.yyh.entity.Student;
import com.yyh.entity.StudentParam;
import com.yyh.entity.Users;

import java.util.List;

import javax.validation.Valid;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author yangyueheng
 * @since 2020-06-05
 */
public interface StudentMapper extends BaseMapper<Student> {

	List<Student> getStu(StudentParam s);

	List<StudentParam> getZxsStu(StudentParam s);

	@Update("update student set is_pay=#{isPay},pay_time=now(),pay_money=#{payMoney} where stu_id=#{stuId}")
	boolean updateZxsStu(@Valid Student student);

	List<StudentParam> getWlzxStu(StudentParam s);

	@Insert("insert into student (stu_name,stu_sex,stu_age,stu_xl,stu_static,stu_origin,stu_www,stu_orgin_dept,is_bb,stu_zx_name,stu_phone,stu_qq,stu_wx,stu_address,create_time,zxs_id,wlzx_id,path) values (#{stuName},#{stuSex},#{stuAge},#{stuXl},#{stuStatic},#{stuOrigin},#{stuWww},#{stuOrginDept},#{isBb},#{stuZxName},#{stuPhone},#{stuQq},#{stuWx},#{stuAddress},now(),#{zxsId},#{wlzxId},#{path})")
	boolean insertStu(Student student);

	@Insert("insert into follow (student_id,follow_time,follow_fs,next_follow_time,content) values (#{studentId},now(),#{followFs},#{nextFollowTime},#{content})")
	boolean insertFollow(Follow follow);

}
